<?php
/**
 * Created by PhpStorm.
 * User: wangsentao
 * Date: 2018/3/12
 * Time: 下午6:17
 */

namespace app\api\repository;


use app\common\Model\WithdrawLog;
use app\common\Service;

class WithdrawLogRespository extends Service
{
    public function createDrawLog($uid, $zfb_account, $zfb_uname, $amount, $order_num)
    {
        $model = model("app\common\Model\WithdrawLog");

        $model->uid = $uid;
        $model->zfb_account = $zfb_account;
        $model->zfb_uname = $zfb_uname;
        $model->status = WithdrawLog::$log_status['WD_COMMIT'];
        $model->amount = $amount;
        $model->operator_uid = '';
        $model->order_num = $order_num;

        if ($model->save()) {
            return $model->getData();
        }

        return $model->getError();
    }
}